/*
 * @Author: ZAL 2177624751@qq.com
 * @Date: 2025-03-30 15:30:00
 * @LastEditors: ZAL 2177624751@qq.com
 * @LastEditTime: 2025-03-30 13:54:17
 * @FilePath: \shop_app_vue3\api\product.js
 * @Description: 商品相关API
 */
import request from '../utils/request.js';

// 获取商品分类列表
export const getCategories = () => {
    return request.get('/api/category/list');
};

// 搜索商品
export const searchProducts = (keyword) => {
    return request.get('/api/product/search', { params: { keyword } });
};

// 获取商品详情
export const getProductDetail = (id) => {
    return request.get(`/api/fruit/detail/${id}`);
};


// 获取推荐商品
export const getRecommendProducts = (limit = 6) => {
    return request.get(`/api/fruit/recommend?limit=${limit}`);
};

